package LC;

import java.util.ArrayList;

public class LC55 {
    ArrayList<Integer> ans = new ArrayList<>();
    public ArrayList<Integer> inorderTraversal (TreeNode root) {
        // write code here
        dfs(root);
        return ans;

    }
    public void dfs(TreeNode root){
        if(root==null) return;
        dfs(root.left);
        ans.add(root.val);
        dfs(root.right);
    }
}
